package com.jichangxiu.server.platform.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import com.jichangxiu.common.entity.po.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.Accessors;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("platform_log")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@Schema(description = "日志实体")
public class PlatformLog extends BaseEntity {

    @Schema(description = "日志ID")
    @TableId(value = "log_id", type = IdType.ASSIGN_UUID)
    private String logId;

    @TableField("log_no")
    @Schema(description = "日志编号")
    private String logNo;

    @TableField("service_type")
    @Schema(description = "业务类型")
    private String serviceType;

    @TableField("operator_type")
    @Schema(description = "操作类型")
    private String operatorType;

    @TableField("http_method")
    @Schema(description = "请求方式")
    private String httpMethod;

    @TableField("model")
    @Schema(description = "请求模块")
    private String model;

    @TableField("method")
    @Schema(description = "请求方法")
    private String method;

    @TableField("url")
    @Schema(description = "请求地址")
    private String url;

    @TableField("ip")
    @Schema(description = "发送人IP")
    private String ip;

    @TableField("location")
    @Schema(description = "发送人地址")
    private String location;

    @TableField("param")
    @Schema(description = "请求参数")
    private String param;

    @TableField("result")
    @Schema(description = "结果信息")
    private String result;

    @TableField("exception")
    @Schema(description = "异常信息")
    private String exception;

    @TableField("user_id")
    @Schema(description = "用户ID")
    private String userId;

    @TableField(exist = false)
    private String nickName;

    @TableField("tenant_id")
    @Schema(description = "租户ID")
    private String tenantId;

    @TableField(exist = false)
    private String tenantName;

    @TableField("remark")
    @Schema(description = "备注")
    private String remark;

    @TableField("status")
    @Schema(description = "状态（false失败 true成功）")
    private Boolean status;

    @TableLogic
    @TableField("deleted")
    @Schema(description = "是否删除（0否 1是）")
    private String deleted;

}
